<style>
	table tr td {
		text-align:center;
	}
</style>
<form class="form-search" action="" method="post" onsubmit="reload();return false;">
	<a class="btn btn-info" onclick="blacklistAdd()">添加黑名单</a>
	 手机号:<input type="text" name="mobile"/><input type="submit" class="btn" value="搜索"/>

</form>
<table class="table table-bordered table-hover">
	<thead><tr><td><input type="checkbox"/></td><td>记录编号</td><td>姓名</td><td>手机号</td><td>创建时间</td><td>备注</td><td>操作</td></tr></thead>
	<tbody>
		<volist name="list" id="vo">
		<tr id="blacklist_{$vo.id}"><td><input type="checkbox"/></td><td>{$vo.id}</td><td>{$vo.name}</td><td>{$vo.mobile}</td><td>{$vo.create_time}</td><td>{$vo.remark}</td><td width=120>
		<span class="label label-important" style="cursor:pointer" onclick="removeBlacklist({$vo.id})">移除黑名单</span>
		<!--<span class="label label-success" style="cursor:pointer;margin-left:5px" onclick="exportPhone({$vo.inbox_id})">导出</span></td>--></tr>
		</volist>
	</tbody>
</table>
<div class="pagination" style="float:right">
	{$page}
</div>
<script>
	$(function(){
		$("#datetimepicker-start").datetimepicker({format:"yyyy-MM-dd"});
		$("#datetimepicker-end").datetimepicker({format:"yyyy-MM-dd"});
	});
	
	function reload(){
		$("#maincontent").load('__APP__/Contacts/blacklist',{startdate:getInputValueByName('startdate'),enddate:getInputValueByName('enddate'),mobile:getInputValueByName('mobile')});
	}
	function removeBlacklist($id){
		$.getJSON("__APP__/Contacts/removeBlacklist",{id:$id},function(json){
			if(json.status == 1){
				$("#blacklist_"+$id).remove();
			}else{
				$.warn("系统提示","移除失败");
			}
		});
	}
	function blacklistAdd(){
		$.dialog("添加黑名单","__APP__/Contacts/blacklistAdd");
	}
</script>